<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
        // 1.将数组map，filter，reduce，every改写成箭头函数形式
           const arr = [1, 2, 3, 4, 5, 6]
   
   // const arr1 = arr.map(
   //     function (element) {
   //         return element + 1
   //     }
   // )
   // console.log(arr1);
   const aa = arr.map (Element =>{
         return Element+1
       }
   )
   console.log(aa);
   
   
   // const new_arr = arr.filter(
   //     function (e){
   //         return e%2==0  //true：返回 false：不符合条件=>过滤
   //     }
   // )
   const namearr = arr.filter(e =>{
           return e%2==0  
      }
   )
   console.log(namearr);
   
   // var sum = arr.reduceRight(
   //     function (v1,v2){
   //         return v1*v2
   //     }
   // )
   var cc =arr.reduceRight((v1,v2) =>{
       return v1*v2
   }
   )
    console.log(cc);
   
   
   
   // var isMatch = arr.every(
   //     function (e){
   //         return e>1
   //     }
   // )
   var bb =arr.every (e=>{
           return e>1
       }
   )
   console.log(bb);
       </script>
</body>
</html>